<template>
	<view class="bullet-content">
		<view class="mask" v-if="show">
			<view class="bullet-frame">
				<view class="bullet-title-img">
					<image :src="$getImageUrl('/user_client/static/bulletFrame/juxing.png')" mode=""></image>
				</view>
				<view class="bullet-main u-flex u-flex-center">
					<view class="bullet-li">
						<view class="li u-flex-between u-col-center" v-for="(item,index) in msgList" :key="index">
							<view class="li-left u-flex-between">
								<view class="li-title">{{item.type_text}}</view>
								<view class="li-text" v-if="item.type==1">{{item.total_give_money}}元</view>
								<view class="li-text" v-if="item.type==2">{{item.total_coupon_number}}张</view>
								<view class="li-text" v-if="item.type==3">{{item.total_commission_money}}元</view>
							</view>
							<view class="li-button" @click="toJump(item.type)">去看看</view>
						</view>
						<view class="coin">
							<image :src="$getImageUrl('/user_client/static/bulletFrame/jinbi.png')" mode=""></image>
						</view>
					</view>
				</view>
				<view class="close" @click="close">
					<image :src="$getImageUrl('/user_client/static/bulletFrame/guanbi.png')" mode=""></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				windowHeight: 0,
			}
		},
		props: {
			show: {
				type: Boolean,
				default: false
			},
			msgList: {
				type: Array,
				default: () => []
			}
		},
		mounted() {

		},
		methods: {
			toJump(type) {
				if (type == 1) {
					var url = '/pages/giveBalance/index'
				} else if (type == 2) {
					var url = '/pages/user/userCoupon'
				} else {
					var url = '/pages/distribution/commissionBill'
				}
				this.$navigateTo(url)
			},
			close() {
				uni.removeStorageSync('get_msg');
				this.$emit('close');
			}
		}
	}
</script>

<style lang='scss'>
	.bullet-content {
		.mask {
			height: 100%;
			width: 100%;
			position: fixed;
			top: 0;
			background-color: rgba(12, 12, 12, 0.6);
			z-index: 9999;
		}

		.bullet-frame {
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			display: inline-block;

			.bullet-title-img {
				position: absolute;
				top: 50%;
				left: 50%;
				transform: translate(-50%, -300%);

				image {
					width: 631rpx;
					height: 121rpx;
					display: block;
				}
			}

			.bullet-main {
				width: 601rpx;
				height: 602rpx;
				background-image: url('../../static/bulletFrame/beijing.png');
				background-size: 100% 100%;
				margin: 0 auto;
				padding: 70rpx 0;
				box-sizing: border-box;

				.li {
					width: 528rpx;
					height: 119rpx;
					background-image: url('../../static/bulletFrame/yuanjiao.png');
					background-size: 100% 100%;
					margin: 0 auto;
					padding: 0 40rpx;
					box-sizing: border-box;
					margin-top: 30rpx;

					.li-left {
						.li-title {
							padding-right: 20rpx;
							font-size: 30rpx;
							font-weight: bold;
							color: #020202;
						}

						.li-text {
							font-size: 30rpx;
							color: #F45351;
						}
					}

					.li-button {
						border: 1rpx solid #F45351;
						border-radius: 24rpx;
						padding: 5rpx 20rpx;
						box-sizing: border-box;
						font-size: 26rpx;
						color: #F45351;
					}
				}

				.coin {
					position: absolute;
					right: 60rpx;
					bottom: 125rpx;

					image {
						width: 52rpx;
						height: 50rpx;
						display: block;
					}
				}
			}

			.close {
				margin-top: 20rpx;

				image {
					width: 90rpx;
					height: 90rpx;
					display: block;
					margin: 0 auto;
				}
			}
		}
	}
</style>